


import requests


headers ={
   "User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1"
    }  # 定制请求头
proxies = {"http": "http://183.33.129.148"}  # 代理ip
#response=requests.get(url=targeturl,proxies=proxies,headers=headers,timeout=5).status_code
html = requests.get('http://www.baidu.com',proxies=proxies,headers=headers,timeout=5)
html.encoding = 'utf-8'
print(html.text)




